﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using Table_Dal;
namespace Table_Dal
{
    public class ThiSinhBLL
    {
        ThiSinhDAL tsdal;
        public int LogIn(string p1, string p2)
        {
            tsdal = new ThiSinhDAL();
            ThiSinhTbl ts = tsdal.ThongTinThiSinh(p1);
            if (ts.MSSV==null)
                return -1;
            else
            {
                if (ts.MSSV == p1)
                {
                    if (ts.MatKhau == p2)
                        return 1;
                }
                return 0;
            }
        }
        public ThiSinhTbl ThongTinThiSinh(string p1)
        {
            tsdal = new ThiSinhDAL();
            return tsdal.ThongTinThiSinh(p1);
        }

        public List<ThiSinhTbl> LayTatCaThiSinh_Diem(string p)
        {
            tsdal = new ThiSinhDAL();
            return tsdal.LayTatCaThiSinh_Diem(p);
        }

        public List<ThiSinhTbl> LayTatCaThiSinh()
        {
            tsdal = new ThiSinhDAL();
            return tsdal.LayTatCaThiSinh();
        }

        public void Sua(ThiSinhTbl tsinh)
        {
            tsdal = new ThiSinhDAL();
            tsdal.Sua(tsinh);
        }

        public void Them(ThiSinhTbl tsinh)
        {
            tsdal = new ThiSinhDAL();
            tsdal.Them(tsinh);
        }
        public bool KiemtraKey(string Ma)
        {
            tsdal = new ThiSinhDAL();
           return tsdal.KiemtraKey(Ma);
        }

        public void Xoa(string item)
        {
            tsdal = new ThiSinhDAL();
            tsdal.Xoa(item);
        }
    }
}
